#ifndef HITTABLE_H
#define HITTABLE_H


class material;


//record hit event
class hit_record {
public:
	point3 pt;
	vec3 norm;
	shared_ptr<material> mat;
	double t;
	bool front_face;

	void set_face_normal(const ray& _ray, const vec3& out_norm) {
		// set hit normal vector 
		front_face = dot(_ray.direction(), out_norm) < 0;
		norm = front_face ? out_norm : -out_norm;
	}

};


//virtual class for hittable object
class hittable {
public:
	virtual ~hittable() = default;

	virtual bool hit(const ray& _ray, interval ray_t, hit_record& rec) const = 0;

};








#endif // !HITTABLE_H

